Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smithy/protocol-http

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/protocol-http

[![NPM version](https://img.shields.io/npm/v/@smithy/protocol-http/latest.svg)](https://www.npmjs.com/package/@smithy/protocol-http) [![NPM downloads](https://img.shields.io/npm/dm/@smithy/protocol-http.svg)](https://www.npmjs.com/package/@smithy/protocol

  • 4.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is @smithy/protocol-http?

@smithy/protocol-http is a package that provides HTTP utilities for the Smithy framework, which is used to build SDKs for AWS services. It includes classes and functions to create and manipulate HTTP requests and responses, making it easier to interact with HTTP-based APIs.

What are @smithy/protocol-http's main functionalities?

Creating HTTP Requests

This feature allows you to create an HTTP request object with specified method, hostname, and path.

const { HttpRequest } = require('@smithy/protocol-http');

const request = new HttpRequest({
  method: 'GET',
  hostname: 'example.com',
  path: '/path'
});

console.log(request);

Handling HTTP Responses

This feature allows you to create an HTTP response object with specified status code, headers, and body.

const { HttpResponse } = require('@smithy/protocol-http');

const response = new HttpResponse({
  statusCode: 200,
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ message: 'Success' })
});

console.log(response);

Parsing HTTP Headers

This feature allows you to parse raw HTTP headers into a structured object.

const { parseHeaders } = require('@smithy/protocol-http');

const rawHeaders = 'Content-Type: application/json\nContent-Length: 123';
const headers = parseHeaders(rawHeaders);

console.log(headers);

Other packages similar to @smithy/protocol-http

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc